package com.le.tester.common.enums;

/**
 * Created by le
 */
public enum ResponseCode {

    SUCCESS(0, "SUCCESS"),
    ERROR(1, "ERROR"),
    SMS_SUCCESS(2000, "SMS_SUCCESS"),
    SMS_FIRST_DAY(2001, "SMS_FIRST_DAY"),
    //成功的代码统一2开头，不成功的统一4开头，默认的success和error除外
    NEED_LOGIN(4000, "NEED_LOGIN"),
    ILLEGAL_ARGUMENT(4001, "ILLEGAL_ARGUMENT"),
    SMS_ERROR(4002, "SMS_ERROR"),
    SMS_TIME_NUM_LIMIT(4003, "SMS_TIME_NUM_LIMIT"),
    SMS_INTERVAL_TIME_LIMIT(4004, "SMS_INTERVAL_TIME_LIMIT"),
    REQUEST_API_LIMIT(4005, "REQUEST_API_LIMIT");

    private final int code;
    private final String desc;


    ResponseCode(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    @Override
    public String toString() {
        return "ResponseCode{" +
                "code=" + code +
                ", desc='" + desc + '\'' +
                '}';
    }
}
